home *** CD-ROM | disk | FTP | other *** search
- Path: ocbbs.gen.nz!not-for-mail
- From: steve@hn.ocbbs.gen.nz (Steve Detoni)
- Newsgroups: comp.lang.c
- Subject: Re: Segmentation Fault ???
- Date: 16 Mar 1996 23:41:29 +1300
- Message-ID: <4ie5sp$77c@hn.ocbbs.gen.nz>
- References: <4hsa7i$en3@wraith.its.uow.edu.au>
- NNTP-Posting-Host: hn.hn.planet.gen.nz
- X-Newsreader: TIN [version 1.2 PL2]
-
- Theeradech Paopeng (tp02@wraith.its.uow.edu.au) wrote:
- : Hello to all.
- : I'm here to ask you guys about the "Segmentation Fault".
- : I was run my program on Unix and I got run_time_error say that "Segmentation
- : Fault". I really no idea how to fix that problem. One more thing I have to tell to fix that problem. One more thing I have to tell
- : you guys is my program using pointer.
- : Are there anyone here got any idea what wrong with my program???
- : I really appreciate that if someone here can give me some hint to solve with
- : that problem.
- : Hope to hear from you very soon.
- O.k, the answer is simple. You are accessing
- a piece of memory that doesn't belong to your program. Have you ever herd
- of the NULL Pointer assignment error under DOS, well this is the same
- thing. The most likly problem is that you are trying to read some
- information as memory address 0, I know this as it's usually my problem
- when i get this error message. Do not heed this error message as it's
- Unix protecting itself from a program corrupting the system, plus it makes
- for better/safer programs.
-
- As simple way find the problem, first find the function where it's
- occuring, and test each pointer assignment after it. Maybe even look uop
- the assert() in the C libraries, this test function may provide additional
- help.
-
- Steve.
-